﻿using System;
using System.IO;
using System.Reflection;

namespace VivendoByte.UploaderWSS
{
    public class ResourceHelper
    {
        public static string GetResourceContent(string resourceName)
        {
            Stream stm = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName);
            byte[] buffer = new byte[stm.Length];
            stm.Read(buffer, 0, (int)stm.Length);
            stm.Close();
            stm.Dispose();

            System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
            string ret = enc.GetString(buffer);
            ret = ret.Replace("?", string.Empty);
            ret = ret.Replace("\r", string.Empty);
            ret = ret.Replace("\n", string.Empty);

            return ret;
        }
    }
}